package com.test.user.controller;

import com.test.user.domain.dto.UserRepDto;
import com.test.user.domain.po.User;
import com.test.user.service.IUserService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

@RequestMapping("/user")
@RestController
@RequiredArgsConstructor
public class UserController {
    private final IUserService userService;
    @GetMapping("/{id}")
    public User getUser(@PathVariable("id") Long id) {
       return userService.getById(id);
    }

    @PostMapping("/login")
    public String login(@RequestBody UserRepDto userRepDto) {
        return userService.login(userRepDto);
    }

}
